import type { Ref } from 'vue'

// 定义模型接口
export interface StoreInterface {
  view: Ref<{
    data: any[]
    page: number
    pageSize: number
    total: number
    status: number
    loading: boolean
  }>

  filterParams: Ref<{
    page: number
    pageSize: number
    limit: number
  }>

  [key: string]: any

  searchData: Function
  addData: Function
  deleteData: Function
  updateData: Function
  abortRequest: Function
}

// 定义返回接口
export interface ResultInterface {
  data: {
    data: object[]
    page: number
    pageSize: number
    total: number
  }
  code: number
}

// 定义错误接口
export interface ErrorInterface {
  message: string
  code: string
  name: string
}
